04-612-307 ระบบคอมพ วเตอร และการเช อมโยง Computer Systems and Interfacing บทท 1 พ นฐานด จ ตอล สาขาว ชาว ศวกรรมคอมพ วเตอร คณะว ศวกรรมศาสตร มหาว ทยาล ยเทคโนโลย ราชมงคลพระนคร
Digital and Analog Quantities
Digital and Analog Quantities Analog quantities have continuous values Digital quantities have discrete sets of values
Digital and Analog Quantities Analog quantities have continuous values Digital quantities have discrete sets of values
Digital and Analog Quantities Types of electronic devices or instruments: Analog Digital Combination analog and digital
Binary Digits, Logic Levels, and Digital Waveforms
Binary Digits, Logic Levels, and Digital Waveforms The conventional numbering system uses ten digits: 0,1,2,3,4,5,6,7,8, and 9. The binary numbering system uses just two digits: 0 and 1.
Binary Digits, Logic Levels, and Digital Waveforms The two binary digits are designated 0 and 1 They can also be called LOW and HIGH, where LOW = 0 and HIGH = 1
Binary Digits, Logic Levels, and Digital Waveforms Binary values are also represented by voltage levels
Binary Digits, Logic Levels, and Digital Waveforms Major parts of a digital pulse Base line Amplitude Rise time (t r ) Pulse width (t w ) Fall time (t f )
Binary Digits, Logic Levels, and Digital Waveforms t w = pulse width T = period of the waveform f = frequency of the waveform f 1 T
Binary Digits, Logic Levels, and Digital Waveforms Duty cycle t w 100% T The duty cycle of a binary waveform is defined as:
Basic Logic Operations
Basic Logic Operations There are only three basic logic operations:
Basic Logic Operations The NOT operation When the input is LOW, the output is HIGH When the input is HIGH, the output is LOW The output logic level is always opposite the input logic level.
Basic Logic Operations The AND operation When any input is LOW, the output is LOW When both inputs are HIGH, the output is HIGH Switch S1 AND Switch S2 must be closed to light the lamp
Basic Logic Operations The OR operation When any input is HIGH, the output is HIGH When both inputs are LOW, the output is LOW Switch S1 OR Switch S2 (or both of them) must be closed to light the lamp
Introduction Gates are identified by their function: NOT, AND, NAND, OR, NOR, EX-OR and EX-NOR. Switch S1 AND Switch S2 must be closed to light the lamp Switch S1 OR Switch S2 (or both of them) must be closed to light the lamp
Three basic logic gates
Common logic gates NAND and NOR gates are logically equivalent to AND and OR gates followed by inverters. Since NAND is actually easier to build, ANDs are often constructed as inverted NAND gates.
Example: logic diagram for a + b c
More complicated expression The logic diagram above depicts ((ab + bc )a) For a parenthesized expression, construct parenthesized portion first Note the connectors ( ) used to indicate a continuation of the same input (for a and b)
Same expression, abbreviated Two inverters eliminated: first by including c as an input (instead of c) and second by making the third AND gate a NAND gate In this version, inputs a and b are shown multiple times use same symbols, so we know they re the same inputs
One more example To translate logic diagram to Boolean expression: label output of each gate (starting from left) with appropriate subexpression output of last gate is full expression
Fixed-Function Integrated Circuits
Fixed-Function Integrated Circuits IC package styles Dual in-line package (DIP) Small-outline IC (SOIC) Flat pack (FP) Plastic-leaded chip carrier (PLCC) Leadless-ceramic chip carrier (LCCC)
Fixed-Function Integrated Circuits Dual in-line package (DIP)
Fixed-Function Integrated Circuits Small-outline IC (SOIC)
Fixed-Function Integrated Circuits Flat pack (FP)
Fixed-Function Integrated Circuits Plastic-leaded chip carrier (PLCC)
Fixed-Function Integrated Circuits Leadless-ceramic chip carrier (LCCC)
Introduction to Programmable Logic
Introduction to Programmable Logic SPLD Simple programmable logic devices CPLD Complex programmable logic devices FPGA Field-programmable gate arrays
SPLD Introduction to Programmable Logic PAL (programmable array logic) GAL (generic array logic) PLA (programmable logic array) PROM (programmable read-only memory)
Test and Measurement Instruments Analog Oscilloscope Digital Oscilloscope Logic Analyzer Logic Probe, Pulser, and Current Probe DC Power Supply Function Generator Digital Multimeter
Number Systems
Decimal Numbers The decimal number system has ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 The decimal numbering system has a base of 10 with each position weighted by a factor of 10:
Binary Numbers The binary number system has two digits: 0 and 1 The binary numbering system has a base of 2 with each position weighted by a factor of 2:
Decimal-to-Binary Conversion
Decimal-to-Binary Conversion Sum-of-weights method Repeated division-by-2 method Conversion of decimal fractions to binary
Binary Arithmetic
Binary Arithmetic Binary addition Binary subtraction Binary multiplication Binary division
Complements of Binary Numbers
Complements of Binary Numbers 1 s complements 2 s complements
Complements of Binary Numbers 1 s complement
Complements of Binary Numbers 2 s complement
Signed Numbers
Signed Numbers Signed-magnitude form 1 s and 2 s complement form Decimal value of signed numbers Range of values Floating-point numbers
Signed Numbers Signed-magnitude form The sign bit is the left-most bit in a signed binary number A 0 sign bit indicates a positive magnitude A 1 sign bit indicates a negative magnitude
Signed Numbers 1 s complement form A negative value is the 1 s complement of the corresponding positive value 2 s complement form A negative value is the 2 s complement of the corresponding positive value
Signed Numbers Decimal value of signed numbers Sign-magnitude 1 s complement 2 s complement
Signed Numbers Range of Values 2 s complement form: (2 n 1 ) to + (2 n 1 1)
Hexadecimal Numbers
Hexadecimal Numbers Decimal, binary, and hexadecimal numbers
Hexadecimal Numbers Binary-to-hexadecimal conversion Hexadecimal-to-decimal conversion Decimal-to-hexadecimal conversion
Hexadecimal Numbers Binary-to-hexadecimal conversion 1. Break the binary number into 4-bit groups 2. Replace each group with the hexadecimal equivalent
Hexadecimal Numbers Hexadecimal-to-decimal conversion 1. Convert the hexadecimal to groups of 4-bit binary 2. Convert the binary to decimal
Hexadecimal Numbers Decimal-to-hexadecimal conversion Repeated division by 16
Binary Coded Decimal (BCD)
Binary Coded Decimal (BCD) Decimal and BCD digits
Digital Codes
Digital Codes Gray code ASCII code
Digital Codes Gray code
Digital Codes ASCII code (control characters)
Digital Codes ASCII code (graphic symbols 20h 3Fh)
Digital Codes ASCII code (graphic symbols 40h 5Fh)
Digital Codes ASCII code (graphic symbols 60h 7Fh)
Digital Codes Extended ASCII code (80h FFh) Non-English alphabetic characters Currency symbols Greek letters Math symbols Drawing characters Bar graphing characters Shading characters
Decoders
Decoders Binary decoder 4-bit decoder BCD-to-decimal decoder BCD-to-7-segement decoder
Decoders Binary decoder The output is 1 only when: A 0 = 1 A 2 = 0 A 3 = 0 A 4 = 1 This is only one of an infinite number of examples
Encoder/Decoder Vocabulary ENCODER- a digital circuit that produces a binary output code depending on which of its inputs are activated. DECODER- a digital circuit that converts an input binary code into a single numeric output.
ENCODERS AND DECODERS A 0 O 0 A 0 O 0 A 1 O 1 A 1 O 1 A 2 A 3 ENCODER O 2 A 2 DECODER O 2 O 3 A 4 O 4 A 5 O 5 A 6 O 6 A 7 O 7 ONLY ONE INPUT ACTIVATED AT A TIME BINARY CODE OUTPUT BINARY CODE INPUT ONLY ONE OUTPUT ACTIVATED AT A TIME
THE 8421 BCD CODE BCD stands for Binary-Coded Decimal. A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9. Example: Decimal number 4926 4 9 2 6 8421 BCD coded number 0100 1001 0010 0110
ELECTRONIC ENCODER - DECIMAL TO BCD BCD output Decimal input 0 10 0 1 0 1 7 5 0 3 Decimal to BCD Encoder Encoders are available in IC form. This encoder translates from decimal input to BCD output.
10 line to 4 line Encoder
10 line to 4 line Encoder DECIMA L BINA RY (BCD) ENCODER 8 4 2 1 9 5V 8 5V 7 5V 6 5V 5 5V 4 5V 3 5V 2 5V 1 5V 74147 I9 I8 I7 I6 I5 I4 I3 I2 I1 A3 A2 A1 A0
4 line to 10 line Decoder DECIMA L 9 BINA RY (BCD) 8 0V 4 0V 2 0V 1 0V DECODER 74LS42 9 87 A3 A2 A1 A0 6 54 3 21 0 8 7 6 5 4 3 2 1 0
DECODERS: BCD TO 7-SEGMENT DECODER/DRIVER BCD input 0 01 10 10 Decimal output LED BCD-to- 7-Segment Decoder/ Driver Electronic decoders are available in IC form. This decoder translates from BCD to decimal. Decimals are shown on an 7-segment LED display. This IC also drives the 7-segment LED display.
7-segment display There are two types of 7 segment LED displays; common - anode common - cathode 81
Common Anode In common anode, the anode of all of the LEDs are tied together to positive of the power supply (V cc ) as shown 82
Common Cathode In common cathode, the cathode of all of the LEDs are tied together to ground as shown. GND 83
TEST Q #1- #2- #3- #4- #5- What is the decimal output from the decoder that appears on the 7-segment display? Answer: 30 97 6 BCD input 10 0 01 01 1 0 Decimal output BCD-to- 7-Segment Decoder/ Driver?
BCD-TO-SEVEN SEGMENT DECODER DRIVER V+ 5V A3 A2 A1 A0 74LS47 test RBI g f e d c b a RBO abcdef g.